Add 'arc' style and xcsv support for tracks and routes
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 17 Jul 2003 23:25:46 +0000 (23:25 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 17 Jul 2003 23:25:46 +0000 (23:25 +0000)
gpsbabel/csv_util.c
gpsbabel/style/arc.style [new file with mode: 0644]

index 9d3c7701ab36fbdb024603f10c4409f9fab90fc4..c6014dc73d11b06e444953bf47f28c8a7e0e495b 100644 (file)
@@ -795,6 +795,12 @@ xcsv_waypt_pr(const waypoint *wpt)
     index++;
 }
 
+static void
+xcsv_noop(const route_head *wp)
+{
+               /* no-op */
+}
+
 /*****************************************************************************/
 /* xcsv_data_write(void) - write prologues, spawn the output loop, and write */
 /*                         epilogues.                                        */
@@ -810,7 +816,18 @@ xcsv_data_write(void)
         ogp = (ogue_t *) elem;
         fprintf (xcsv_file.xcsvfp, "%s%s", ogp->val, xcsv_file.record_delimiter);
     }
-    waypt_disp_all(xcsv_waypt_pr);
+
+    switch (global_opts.objective ) {
+        case wptdata:
+            waypt_disp_all(xcsv_waypt_pr);
+            break;
+        case rtedata:
+       case trkdata:
+            route_disp_all(xcsv_noop,xcsv_noop,xcsv_waypt_pr);
+            break;
+        default:
+            break;
+    } 
 
     /* output epilogue lines, if any. */
     QUEUE_FOR_EACH(&xcsv_file.epilogue, elem, tmp) {
diff --git a/gpsbabel/style/arc.style b/gpsbabel/style/arc.style
new file mode 100644 (file)
index 0000000..82fcbc9
--- /dev/null
@@ -0,0 +1,21 @@
+# gpsbabel XCSV style file
+#
+# Format: GPSBabel arc filter format
+# Author: Ron Parker
+#   Date: 17 July 2003
+#
+
+DESCRIPTION            GPSBabel arc filter file
+EXTENSION              txt
+
+#
+# FILE LAYOUT DEFINITIIONS:
+#
+FIELD_DELIMITER                TAB
+RECORD_DELIMITER       NEWLINE
+
+#
+# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
+#
+IFIELD LAT_DECIMAL, "", "%08.5f"
+IFIELD LON_DECIMAL, "", "%08.5f"